home *** CD-ROM | disk | FTP | other *** search
- /* A simpler output function, which does not know about escapes */
- /* $Header: vtputs.c,v 1.3 88/06/03 14:46:02 guido Exp $ */
-
- #include "vtimpl.h"
-
- void
- vtputs(vt, text)
- VT *vt;
- char *text;
- {
- while (*text != EOS) {
- if (PRINTABLE(*text)) {
- register char *end= text;
- while (PRINTABLE(*++text))
- ;
- vtputstring(vt, text, (int) (end-text));
- text= end;
- }
- else switch (*text++) {
-
- case BEL: /* Make some noise */
- wfleep();
- break;
-
- case BS: /* Move 1 left */
- /* Rely on vtsetcursor's clipping */
- vtsetcursor(vt, vt->cur_row, vt->cur_col - 1);
- /* Don't erase --
- that's part of intelligent echoing */
- break;
-
- case TAB: /* Move to next tab stop */
- /* Rely on vtsetcursor's clipping */
- vtsetcursor(vt, vt->cur_row,
- (vt->cur_col & ~7) + 8);
- /* Normalize cursor (may cause scroll!) */
- vtputstring(vt, "", 0);
- break;
-
- case LF: /* Move cursor down in same column */
- vtsetcursor(vt, vt->cur_row + 1, vt->cur_col);
- /* Normalize cursor (may cause scroll!) */
- vtputstring(vt, "", 0);
- break;
-
- case FF: /* Start over */
- vtreset(vt);
- break;
-
- case CR: /* Back to col 0 on same line */
- vtsetcursor(vt, vt->cur_row, 0);
- break;
-
- }
- }
- vtsync(vt);
- }
-